<template>
	<view class="box-shadow bg-w pd30 bdr16">
		<view class="flex space">
			<view class="flex ws80">
				<image class="wh30 bdr8 box-shadow" :src="''"></image>
				<view class="ml30">
					<view class="flex alcenter">
						<view class="store-name text-over ft16 ftw600 text-default">卡夫卡少儿艺术培卡夫卡少儿艺术培…</view>
						<view class="iconfont iconbtn_arrowr text-default ml10"></view>
					</view>
					<view class="text-notice ft14 mt20">2019-09-12 12:00</view>
				</view>
			</view>
			<view  class="w80 flex end ft16 text-theme">
				<view v-if="status == 0">
					待支付
				</view>
				<view v-if="status == 1">
					<view v-if="refund == false">
						待核销
					</view>
					<view v-if="refund == true">
						<view v-if="refundStatus == 0">
							申请退款中
						</view>
						<view v-if="refundStatus == 1">
							等待到帐 <!--同意但是还未到账-->
						</view>
						<view v-if="refundStatus == 2">
							拒绝退款
						</view>
					</view>
				</view>
				
				<view v-if="status == 4">
					已取消
				</view>
				
				<view v-if="status == 8">
					<view v-if="refund == false">
						<view v-if="isComment == false">待评价</view>
						<view v-else>已完成</view>
					</view>
					<view v-if="refund == true">
						退款已完成
					</view>
				</view>
				
			</view>
		</view>
		<view class="line mt30 mb30"></view>
		<navigator url="/pages/member/order/detail">
		<view class="flex">
			<view class="wh80">
				<image class="wh80 bdr8" :src="''"></image>
			</view>
			<view class="ws80 pl30">
				<view class="ft16 text-main">得力炫彩棒蜡笔旋转油画棒…</view>
				<view class="flex space alcenter mt20">
					<view>
						<text class="ft14 text-info">单价：</text>
						<text class="ft14 text-main">￥299</text>
					</view>
					<text class="ft14 text-info">x1</text>
				</view>
				<view v-if="orderType == 0 && status > 0" class="flex space alcenter mt20">
					<view>
						<text class="ft14 text-info">优惠：</text>
						<text class="ft14 text-main">￥5</text>
					</view>
					<view>
						<text class="ft14 text-info">实付：</text>
						<text class="ft18 ftw600 text-theme">￥200</text>
					</view>
				</view> 
				
				<view v-if="orderType == 1 && status > 0" class="flex alcenter mt20">
					<image class="wh20" :src="'icon_diamond'"></image>
					<text class="ft16 ftw600 text-theme ml10">1000 + ￥50</text>
				</view>
				
				<view v-if="status == 0" class="ft14 text-info mt20">
					<text>待支付金额：</text><text class="ft16 ftw600 text-theme ml10">￥100</text>
				</view>
			</view>	
		</view>
		</navigator>
		<view v-if="isAction" class="line mt30 mb30"></view>
		<view v-if="isAction" class="flex end alcenter">
			<view v-if="status == 8 && refund == false" class="btn-small-empty mr20">再来一单</view>
			<view v-if="status == 0" class="btn-small-empty mr20">取消订单</view>
			<view v-if="status == 0" class="btn-small mr20">立即支付</view>
			<view v-if="status == 1 && refund == false" class="btn-small-empty mr20">申请退款</view>
			<view v-if="status == 1 && (refund == false || refundStatus != 1)" class="btn-small-empty mr20">查看券码</view>
			<view v-if="status == 8 && refund == false && isComment == false " class="btn-small-empty mr20">去评价</view>
			<view v-if="status == 1 && refund == true && refundStatus == 0" class="btn-small-empty mr20">放弃申请</view>
		</view>
		
	</view>
</template>

<script>
	export default{
		props:{
			orderType:{
				type:Number,
				default:0,// 0 默认订单  1 积分兑换订单
			},
			status:{
				type:Number,
				default:0 
			},
			refund:{
				type:Boolean,
				default:false,
			},
			refundStatus:{
				type:Number,
				default:0,
			},
			isComment:{
				type:Boolean,
				default:false
			}
		},
		computed:{
			isAction(){
				let status = true;
				if(this.status == 4){
					status = false;
				}else if(this.status == 1){
					if(this.refund == true && this.refundStatus == 1){
						status = false;
					}
				}
				return status;
			}
		},
		data(){
			return {
				
			}
		}
	}
</script>

<style>
	.store-name{
		width: 330rpx;
	}
</style>